﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace MultiSliderSample
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window, INotifyPropertyChanged
    {
        private ObservableCollection<RangeItem> _items = new ObservableCollection<RangeItem>();

        public ObservableCollection<RangeItem> Items
        {
            get
            {
                return _items;
            }
            set
            {
                _items = value;
            }
        }


        public MainWindow()
        {
            InitializeComponent();

            Items.Add(new RangeItem()
            {
                From = 0,
                To = 50,
                IsStatic = true,
                MaxDuration = 100
            });

            Items.Add(new RangeItem()
            {
                From = 50,
                To = 80,
                IsStatic = false,
                MaxDuration = 100
            });

            Items.Add(new RangeItem()
            {
                From = 80,
                To = 100,
                IsStatic = false,
                MaxDuration = 100
            });

            this.DataContext = this;
        }

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
